package thread;

public class ThreadDemo9_1 {
	public static void main(String args[]) throws InterruptedException {
		TestThread tt = new TestThread("线程A");
		tt.start();
		// 循环输出
		
		tt.join(0, 1);
		for (int i = 0; i < 5000; i++) {
			System.out.println("main 线程在运行" + Thread.currentThread().getName() + i);
		}
	}
}

class TestThread extends Thread {
	
	public TestThread(String name){
		super(name);
	}
	
	@Override
	public void run() {
		for (int i = 0; i < 5000; i++) {
			System.out.println("TestThread 在运行" + Thread.currentThread().getName() + i);
		}
	}
}